package com.cheng.frame;

import java.awt.Color;
import java.awt.Font;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.TitledBorder;

import org.dyno.visual.swing.layouts.Constraints;
import org.dyno.visual.swing.layouts.GroupLayout;
import org.dyno.visual.swing.layouts.Leading;

public class CodeViewPanel extends JPanel{
	private static final long serialVersionUID = 1L;
	private CodeViewPanel codeViewPanel;
	private MasterCodePanel masterCodePanel;
	private PrivateCodePanel privateCodePanel;
	private SlaveCodePanel slaveCodePanel;
	private JLabel jLabel0;
	private JLabel jLabel1;
	private JLabel jLabel2;
	
	public CodeViewPanel(){
		codeViewPanel = this;
		codeViewPanel.setBorder(BorderFactory.createTitledBorder(null, "数字印章", TitledBorder.LEADING, TitledBorder.ABOVE_TOP, new Font("SansSerif", Font.BOLD, 12),
				new Color(59, 59, 59)));
		codeViewPanel.setLayout(new GroupLayout());
		masterCodePanel = new MasterCodePanel().getPanel();
		privateCodePanel = new PrivateCodePanel().getPanel();
		slaveCodePanel = new SlaveCodePanel().getPanel();
		codeViewPanel.add(masterCodePanel, new Constraints(new Leading(20, 175, 10, 10), new Leading(10, 175, 10, 10)));
		codeViewPanel.add(privateCodePanel, new Constraints(new Leading(250, 175, 10, 10), new Leading(10, 175, 10, 10)));
		codeViewPanel.add(slaveCodePanel, new Constraints(new Leading(530, 175, 10, 10), new Leading(10, 175, 10, 10)));
		codeViewPanel.add(getJLabel0(), new Constraints(new Leading(80, 60, 10, 10), new Leading(185, 25, 10, 10)));
		codeViewPanel.add(getJLabel1(), new Constraints(new Leading(310, 60, 10, 10), new Leading(185, 25, 10, 10)));
		codeViewPanel.add(getJLabel2(), new Constraints(new Leading(590, 60, 10, 10), new Leading(185, 25, 10, 10)));
	}
	
	public CodeViewPanel getPanel() {
		if (codeViewPanel == null) {
			codeViewPanel = new CodeViewPanel();
		}
		return codeViewPanel;
	}
	
	public void show(){
		
	}
	
	private JLabel getJLabel2() {
		if (jLabel2 == null) {
			jLabel2 = new JLabel();
			jLabel2.setText("数字子章");
		}
		return jLabel2;
	}

	private JLabel getJLabel1() {
		if (jLabel1 == null) {
			jLabel1 = new JLabel();
			jLabel1.setText("数字私章");
		}
		return jLabel1;
	}

	private JLabel getJLabel0() {
		if (jLabel0 == null) {
			jLabel0 = new JLabel();
			jLabel0.setText("数字母章");
		}
		return jLabel0;
	}
	
}
